#ifndef READ_THREAD_H
#define READ_THREAD_H

#include <QObject>
#include <QThread>
#include <QDebug>
#include <QMutex>
#include <QReadWriteLock>
#include <QWaitCondition>
class read_thread : public QThread
{
public:
    read_thread( QWaitCondition &cond,QReadWriteLock &lock,QString &m,QObject *parent = nullptr);
public:
  void stop();
  void setMsg(QString);
protected:
   void run();
private:
   QString &msg;
   bool flag;
   QMutex mutex;
   QReadWriteLock & rwlock;
    QWaitCondition &cond;
};

#endif // READ_THREAD_H
